<?php
class Merchant_WarehouseController extends Zend_Controller_Action
{
	public function shelfLogAction(){
		$productId = $this->_request->productId;
		$page = $this->_request->getParam("page",0);
		$pageSize = $this->_request->getParam("pageSize",20);
		$tmpcond=array('product_id'=>$productId);
		$totalResult = Merchant_Service_ProductStocket::getByCondition($tmpcond,'count(*)','ps_last_update',0,0);
		$results=Merchant_Service_ProductStocket::getByCondition($tmpcond,'*','ps_last_update',$pageSize, $page);
		$return = array("ask" => false);
		if(!empty($results)){
			$return['ask'] = true;
			$return['results'] = $results;
		}
		$return['total'] = count($totalResult);
		die(json_encode($return));
	}
}